package cn.lf.controller;

import cn.lf.dto.system.UserLoginReqDTO;
import cn.lf.dto.system.UserLoginRepDTO;
import cn.lf.service.ApiSystemService;
import cn.lf.utils.ResponseModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author guoyy
 */
@RestController
@RequestMapping("/sys")
@Api(tags = "小程序端用户登录相关接口")
public class ApiSystemController {

    @Autowired
    private ApiSystemService systemService;

    @GetMapping("/login")
    @ApiOperation("登录")
    public ResponseModel<UserLoginRepDTO> login(UserLoginReqDTO params){

        UserLoginRepDTO result = systemService.login(params);

        return ResponseModel.buildSuccessResult(result);
    }

}
